#include <iostream>
#include "../FilterSDK/ia.h"
#include "D5XPLCMsgHelper.h"
#include "../D5XCommon/D5XProtocol.h"
#include "../FilterSDK/NodeMsg.h"

int main()
{
	CNodeMsg msg;
	msg.Command = D5XNodeCmds::plc_control;
	msg.SubDstAddr = std::to_string(ED5XPLCCmdCodes::Cam_11_Photo);
	msg.Message = "FILE,0,D:\\gCam1_cam1.csv";

	int len = CD5XPLCMsgHelper::GetPLCFrameLen();
	unsigned char* pData = NULL;
	IA_MALLOC(pData, unsigned char*, 0, len);

	int status = CD5XPLCMsgHelper::NodeMsg2PLCFrame(&msg, pData, len);
	STATUS_CHECK

	CNodeMsg msg2;
	status = CD5XPLCMsgHelper::PLCFrame2NodeMsg(&msg2, pData, len);
	STATUS_CHECK


	IA_RETURN_OK
}